home *** CD-ROM | disk | FTP | other *** search
/ Aminet 45 / Aminet 45 (2001)(GTI - Schatztruhe)[!][Oct 2001].iso / Aminet / dev / e / yaec.lha / examples / nodelist.e < prev    next >
Text File  |  2001-08-12  |  449b  |  34 lines

  1.  
  2. -> example of using the external linklib nodelist.o
  3.  
  4. EXTERN 'other/nodelist'
  5.  
  6. OBJECT node
  7.    next:PTR TO node
  8.    prev:PTR TO node
  9.    id:LONG
  10. ENDOBJECT
  11.  
  12. OBJECT list OF node
  13.    first:PTR TO node
  14.    last:PTR TO node
  15. ENDOBJECT
  16.  
  17. DEF l:list
  18.  
  19. PROC main()
  20.    DEF n:PTR TO node, a
  21.    FOR a := 10 TO 0 STEP -1
  22.       NEW n
  23.       n.id := a
  24.       AddOrd(l, n)
  25.    ENDFOR
  26.    Traverse(l, {bla})
  27. ENDPROC
  28.  
  29. PROC bla()
  30.    PrintF('node.id=\d\n', A0::node.id)
  31. ENDPROC
  32.  
  33.  
  34.